<?php 
	require_once("models/config.php");
	require_once("ui.php");
	require_once("stats/db.php");
?>

<?php
	if(!isUserLoggedIn()) {
		header ("location: login.php");
		die();
	}

	global $loggedInUser;
	if(! $loggedInUser->isAdministrator()) {
		die();
	}
?>
		
<?php printPageHead(null, null); ?>

	<?php printNavigationBar('index', NAVIGATION_ITEM_USERS) ?>		
		
		<div id="content" class="container_16 clearfix">
			<div class="grid_16">
				<?php
					$userId = $_GET['userid'];
				
					$user = new UserStats($userId);
					$user->loadStats();
					
					printUserDetails($user, true);
				 ?>
			</div>
			
			<?php 
				printSingleUserGraphs($_GET['userid']);
			?>
		</div>

<?php printPageFoot(); ?>
